import request from '@/utils/request'

/**
 *红包活动列表
 * @param data
 * @returns {*}
 */
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/queryPage',
    method: 'post',
    data
  })
}
// 新增红包活动
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/insert',
    method: 'post',
    data
  })
}
// 根据id获取详情
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/get',
    method: 'post',
    data
  })
}
// 修改
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/update',
    method: 'post',
    data
  })
}
// 删除
export function deleteById(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/deleteById',
    method: 'post',
    data
  })
}
/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

/**
 * 更改状态
 * @param data
 * @returns {*}
 */
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/publish',
    method: 'post',
    data
  })
}
/**
 * 参与情况列表
 * @param data
 * @returns {*}
 */
export function queryRecord(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/participation',
    method: 'post',
    data
  })
}
/**
 * 导出统计(脱敏)
 */
export function exportFileMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/downloadParticipationMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/**
 * 导出统计（不脱敏）
 */
export function exportFileNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityBase/downloadParticipationNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
